<?php
@header("Content-type:text/html;charset=GB2312");
defined('BASEPATH') OR exit('No direct script access allowed');

class Channel extends CI_Controller
{
    function index(){
        $my = $this->load->database('default', TRUE);
        $ms = $this->load->database('sqlserver', TRUE);

        $size = 500;
        $page = isset($_GET['page']) ? $_GET['page'] : 1;
        $zongshu = $page * $size;

        $sql = "select top $size * from (select top $zongshu  * from NC_Channel order by ChannelID asc) NC_Channel order by ChannelID desc";
        $msq = $ms->query($sql)->result_array();
        $m = array();
        foreach($msq as $v){
            $k = array(
                'ChannelID'=> $v['ChannelID'],
                'orders'=> $v['orders'],
                'ColorModes'=> $v['ColorModes'],
                'FontModes'=> $v['FontModes'],
                'ChannelName'=> $v['ChannelName'],
                'Caption'=> $v['Caption'],
                'ChannelDir'=> $v['ChannelDir'],
                'StopChannel'=> $v['StopChannel'],
                'IsHidden'=> $v['IsHidden'],
                'LinkTarget'=> $v['LinkTarget'],
                'ChannelType'=> $v['ChannelType'],
                'ChannelUrl'=> $v['ChannelUrl'],
                'modules'=> $v['modules'],
                'ModuleName'=> $v['ModuleName'],
                'BindDomain'=> $v['BindDomain'],
                'DomainName'=> $v['DomainName'],
                'ChannelSkin'=> $v['ChannelSkin'],
                'IsCreateHtml'=> $v['IsCreateHtml'],
                'HtmlExtName'=> $v['HtmlExtName'],
                'StopUpload'=> $v['StopUpload'],
                'MaxFileSize'=> $v['MaxFileSize'],
                'UpFileType'=> $v['UpFileType'],
                'IsAuditing'=> $v['IsAuditing'],
                'AppearGrade'=> $v['AppearGrade'],
                'PostGrade'=> $v['PostGrade'],
                'LeastString'=> $v['LeastString'],
                'MaxString'=> $v['MaxString'],
                'PaginalNum'=> $v['PaginalNum'],
                'LeastHotHist'=> $v['LeastHotHist'],
                'Channel_Setting'=> $v['Channel_Setting'],
                'SortDestination'=> $v['SortDestination'],
                'InfoDestination'=> $v['InfoDestination'],
                'MoreDestination'=> $v['MoreDestination'],
                'setEditor'=> $v['setEditor'],
                'NamedPath'=> $v['NamedPath'],
            );
            $m[] = $k;
        }
        var_dump("<pre>");
        var_dump($m);
    }
}